<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>vue.js常用指令的测试</title>
		<script src="vue.min.js"></script>
	</head>
	<body>
		<div id="app">
			<a v-bind:href="url">
				<span v-text="name"></span>
			</a>
		
			<input type="text" v-model="num1"/> + 
			<input type="text" v-model="num2"/> =
			<span v-text="Number.parseInt(num1)+Number.parseInt(num2)"></span>
			<br/>
			<button v-on:click="clearNum">清空</button>
		</div>
		
	</body>
	<script>
		var VM = new Vue({
			el: '#app',
			data: {
				name: '传智播客',
				num1:0,
				num2:0,
				url: "www.baidu.com"
			},
			methods: {
				clearNum:function(){
					this.num1 = 0;
					this.num2 = 0;
				}
			}
		});
	</script>
</html>
